
function opentWindow(url,width,height,name,resizable){
    var left, top;
    left = parseInt((screen.width - width)/2);
    top  = parseInt((screen.height - height)/2);
    var newWindown= window.open(url, "", "top="+top+",left="+left+",width="+width+",height="+height+",location=no,scrollbars = no,resizable=yes");
    //返回当前窗口
    return newWindown;
}

function changValue(url){
     Ext.Ajax.request({
       url: url,
       params:"",
       success:function(response){
          var result=response.responseText;
          var jsonData =eval('('+result+')');
	         for(var key in jsonData){
                  if(jsonData[key] == 'null' || jsonData[key] == null){ 
                      jsonData[key] = '';
                  }
                  if(document.getElementById(key)){
	                  if(key=="address"){
	                       document.getElementById(key).value=jsonData[key];
	                  }else if(key=="email"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="post"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="ywlxr"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="ywlxrtel"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="gszcdjh"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="csmj"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="zczj"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="fddbr"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="rsJsry"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="rsWxg"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="rsTotal"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="dwslJyrq"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="dwslGyrq"){
	                        document.getElementById(key).value=jsonData[key];
	                  }else if(key=="qyRemarks"){
	                        document.getElementById(key).value=jsonData[key];
	                  }
                 }
               }
           }
  });
}


function changeqylxValue(name,val){
    var objs=document.getElementsByName(""+name);
    for(j=0;j<objs.length;j++){
        if(objs[j].value==val){
        objs[j].checked=true; 
            break; 
        }
    
    }
}
function fromatDate(dateObj){
	var months=dateObj.month+1;
	var years=parseInt(dateObj.year+1900);
	var dates=parseInt(dateObj.date);
	 if(months<10){
	    months="0"+months;
	 }
	 if(dates<10){
	    dates="0"+dates;
	 }
	var ndate = years+"年"+months+"月"+dates+"日";
    return ndate;
}

